#!usr/bin/perl -w

use strict;

die "usage:perl $0 <fa> \n" unless @ARGV == 1;

open A,$ARGV[0];
$/=">";
<A>;
my %h;  my $num=0;  my $len=0;
while(<A>){
    chomp;my @a=split /\n+/;my $seq=join "",@a[1..$#a];
    $h{$a[0]}=$seq; $len=length $seq;
    $num++;
}
close A;
$/="\n";

printf "%5d   %d\n",$num,$len;
foreach my $k(sort keys %h){
    #my $kk=substr($k,0,3);
    printf "%-29s",$k;
    print "$h{$k}\n";
}
